package com.macro.mall.tiny.shejimoshi;

public class SingletonDouble {

    private SingletonDouble(){

    }

    private volatile SingletonDouble singletonlh;


    public SingletonDouble getSingletonDouble(){
            if (singletonlh==null){
                //第一次判断提高效率
                synchronized (SingletonDouble.class) {
                    if (singletonlh==null){
                        //第二次判断为了防止重复创建
                        return new SingletonDouble();
                    }
                }
            }
            return singletonlh;
    }



}
